package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.SysGoods;
import com.ruoyi.system.mapper.SysGoodsMapper;
import com.ruoyi.system.service.ISysGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品Service业务层处理
 *
 * @author yanghua
 * @date 2020-09-02
 */
@Service
public class SysGoodsServiceImpl implements ISysGoodsService {
    @Autowired
    private SysGoodsMapper sysGoodsMapper;

    /**
     * 查询商品
     *
     * @param goodId 商品ID
     * @return 商品
     */
    @Override
    public SysGoods selectSysGoodsById(Long goodId) {
        return sysGoodsMapper.selectSysGoodsById(goodId);
    }

    /**
     * 查询商品列表
     *
     * @param sysGoods 商品
     * @return 商品
     */
    @Override
    public List<SysGoods> selectSysGoodsList(SysGoods sysGoods) {
        return sysGoodsMapper.selectSysGoodsList(sysGoods);
    }

    /**
     * 新增商品
     *
     * @param sysGoods 商品
     * @return 结果
     */
    @Override
    public int insertSysGoods(SysGoods sysGoods) {
        return sysGoodsMapper.insertSysGoods(sysGoods);
    }

    /**
     * 修改商品
     *
     * @param sysGoods 商品
     * @return 结果
     */
    @Override
    public int updateSysGoods(SysGoods sysGoods) {
        return sysGoodsMapper.updateSysGoods(sysGoods);
    }

    /**
     * 批量删除商品
     *
     * @param goodIds 需要删除的商品ID
     * @return 结果
     */
    @Override
    public int deleteSysGoodsByIds(Long[] goodIds) {
        return sysGoodsMapper.deleteSysGoodsByIds(goodIds);
    }

    /**
     * 删除商品信息
     *
     * @param goodId 商品ID
     * @return 结果
     */
    @Override
    public int deleteSysGoodsById(Long goodId) {
        return sysGoodsMapper.deleteSysGoodsById(goodId);
    }
}
